package com.example.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

 @RestController
 public class NewsController {

 @GetMapping("/getNews")
 @PreAuthorize("hasAnyAuthority('sys:news:select')")
 public String getNews(){
 return "查询权限成功";
 }

 @PostMapping("/insertNews")
 @PreAuthorize("hasAnyAuthority('sys:news:add')")
public String insertNews(){
 return "添加权限成功";
 }

 @PutMapping("/updateNews")
 @PreAuthorize("hasAnyAuthority('sys:news:update')")
 public String updateNews(){
  return "更新权限成功";
 }

 @DeleteMapping("/deleteNews")
 @PreAuthorize("hasAnyAuthority('sys:news:delete')")
 public String deleteNews(){
 return "删除权限成功";
 }

 }